import fetch from '@/utils/fetch'

const TaskListApi = {
  getPageList (params) {
    return fetch({
      url: 'http://admin.ck9696.com:8009/api/taskDetails/page',
      method: 'get',
      params: params
    })
  },
  update (id, data) {
    return fetch({
      url: 'http://admin.ck9696.com:8009/api/taskDetails/' + id,
      method: 'put',
      data: data
    })
  },
  add (data) {
    return fetch({
      url: 'http://admin.ck9696.com:8009/api/taskDetails',
      method: 'post',
      data: data
    })
  },
  del (data) {
    return fetch({
      url: 'http://admin.ck9696.com:8009/api/taskDetails',
      method: 'delete',
      data: data
    })
  },
  run (params) {
    return fetch({
      url: 'http://admin.ck9696.com:8009/api/taskDetails/runTask/' + params,
      method: 'get',
      params: params
    })
  },
  optionTask (params) {
    return fetch({
      url: 'http://admin.ck9696.com:8009/api/taskDetails/optionTask/' + params,
      method: 'get',
      params: params
    })
  }
}
export default TaskListApi
